package com.iraeta.service.xiangmu.impl;

import com.iraeta.dao.xiangmu.GysDao;
import com.iraeta.entity.xiangmu.Gys;
import com.iraeta.service.xiangmu.GysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GysServiceImpl implements GysService {
    @Autowired
    GysDao gysDao;

    @Override
    public Gys getGys(int id) {
        return gysDao.selectByPrimaryKey(id);
    }

    @Override
    public List<Gys> listXmGys(int xmId) {
        return gysDao.selectByXmId(xmId);
    }

    @Override
    public void addGys(Gys gys) {
        gysDao.insert(gys);
    }

    @Override
    public void updateGys(Gys gys) {
        gysDao.updateByPrimaryKey(gys);
    }

    @Override
    public void deleteGys(int id) {
        gysDao.deleteByPrimaryKey(id);
    }
}
